﻿using Nature.Core.DDD;
using Nature.Core.DDD.UnitOfWork;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nature.Repository.UnitOfWork
{
    public abstract class UnitOfWork:IUnitOfWork
    {
        public virtual void Create(IAggregationRoot unitWork, IUnitOfWorkRepository unitOfWorkRepository)
        {
            unitOfWorkRepository.Create(unitWork);
        }

        public virtual void Update(IAggregationRoot unitWork, IUnitOfWorkRepository unitOfWorkRepository)
        {
            unitOfWorkRepository.Update(unitWork);
        }

        public virtual void Delete(IAggregationRoot unitWork, IUnitOfWorkRepository unitOfWorkRepository)
        {
            unitOfWorkRepository.Delete(unitWork);
        }

        public abstract void Commit();

        public abstract void Dispose();
    }
}
